<?php
/**
 * @package      OWNServices
 * @subpackage   site
 *
 * @author       Sanawin Tinsuwan
 * @copyright    Copyright (C) 20014 Sanawin Tinsuwan. All rights reserved.
 * @license      http://www.gnu.org/licenses/gpl.html GNU/GPL, see LICENSE.txt
 */

defined('_JEXEC') or die();

JHtml::_('behavior.formvalidation');

?>
<script type="text/javascript">
	Joomla.submitbutton = function(task)
	{
		if (task == 'member.cancel' || document.formvalidator.isValid(document.id('member-form')))
		{
			Joomla.submitform(task, document.getElementById('member-form'));
		}
	}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_ownservices&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="member-form" class="form-validate">
	<div class="row">
		<!-- left column -->
		<div class="col-md-7">
			<!-- general form elements -->
			<div class="box box-primary">
				<div class="box-header">
					<h3 class="box-title">Member Details</h3>
					<div class="box-tools pull-right">
					</div>
				</div><!-- /.box-header -->
				<div class="box-body">
					<div class="form-group">
						<?php echo $this->form->getLabel('firstname'); ?>
						<?php echo $this->form->getInput('firstname'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('lastname'); ?>
						<?php echo $this->form->getInput('lastname'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('nickname'); ?>
						<?php echo $this->form->getInput('nickname'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('occupation'); ?>
						<?php echo $this->form->getInput('occupation'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('secret_pin'); ?>
						<?php echo $this->form->getInput('secret_pin'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('currency'); ?>
						<?php echo $this->form->getInput('currency'); ?>
					</div>
				</div>
				<div class='box-header'>
				   <h3 class='box-title'>Access Level</h3>
				</div><!-- /.box-header -->
				<div class="box-body">
					<div class="form-group">
						<?php echo $this->form->getLabel('role'); ?>
						<?php echo $this->form->getInput('role'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('branch_id'); ?>
						<?php echo $this->form->getInput('branch_id'); ?>
					</div>
				</div>
				<div class='box-header'>
				   <h3 class='box-title'>Document / Electronic Data Source</h3>
				</div><!-- /.box-header -->
				<div class="box-body">
					<div class="form-group">
						<?php echo $this->form->getLabel('doc_type'); ?>
						<?php echo $this->form->getInput('doc_type'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('doc_number'); ?>
						<?php echo $this->form->getInput('doc_number'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('doc_expire'); ?>
						<?php echo $this->form->getInput('doc_expire'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('issuer'); ?>
						<?php echo $this->form->getInput('issuer'); ?>
					</div>
				</div>
				<div class='box-header'>
				   <h3 class='box-title'>Contact Details</h3>
				</div><!-- /.box-header -->
				<div class="box-body">
					<div class="form-group">
						<?php echo $this->form->getLabel('address'); ?>
						<?php echo $this->form->getInput('address'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('city'); ?>
						<?php echo $this->form->getInput('city'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('province'); ?>
						<?php echo $this->form->getInput('province'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('country'); ?>
						<?php echo $this->form->getInput('country'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('postcode'); ?>
						<?php echo $this->form->getInput('postcode'); ?>
					</div>
					<div class="form-group">
						<?php echo $this->form->getLabel('email'); ?>
						<?php echo $this->form->getInput('email'); ?>
					</div>
				</div>
			</div>
		</div><!--/.col (left) -->
		<!-- right column -->
		<div class="col-md-5">
			<!-- general form elements disabled -->
			<div class="box box-warning">
				<div class="box-header">
					<h3 class="box-title">Upload Images</h3>
				</div><!-- /.box-header -->
				<div class="box-body" id="image_ls">
					<div class="form-group">
						<label><?php echo JText::_('COM_OWNSERVICES_IMAGE'); ?></label>
                        <input type="file" name="images[]" />
					</div>
				</div>
				<div class="box-footer">
					<a href="javascript:void(0);" id="add_image">
						<i class="fa fa-fw fa-plus-square"></i>
						<?php echo JText::_('COM_OWNSERVICES_ADD_IMAGE'); ?>
					</a>
				</div>
			</div>
		</div>
	</div>
	<?php echo $this->form->getInput('id'); ?>
	<input type="hidden" name="task" value="member.edit" />
	<?php echo JHtml::_('form.token'); ?>
</form>
<div class="box-footer">
	<button class="btn btn-primary" onclick="Joomla.submitbutton('member.save')">
		<?php echo JText::_('COM_OWNSERVICES_SAVE'); ?>	
	</button>
	<button class="btn btn-danger" onclick="Joomla.submitbutton('member.cancel')">
		<?php echo $this->item->id?JText::_('COM_OWNSERVICES_CLOSE'):JText::_('COM_OWNSERVICES_CANCEL'); ?>
	</button>
</div>
<!-- AdminLTE App -->
<script src="<?php echo JUri::base(true).'/media/com_ownservices/js/AdminLTE/app.js'; ?>" type="text/javascript"></script>